package com.sino.struts2;

import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;
import com.sino.business.IZljszkService;
import com.sino.model.ZljszkModel;

public class ZljszkAction extends ActionSupport{
	private IZljszkService zljszkService = null;
	private ZljszkModel zljszkModel = null;
	private String zlid;
	
	public String getZlid() {
		return zlid;
	}
	public void setZlid(String zlid) {
		this.zlid = zlid;
	}
	//显示专利技术状况
	public String viewZljszk(){
		return this.SUCCESS;
	}
	//保存专利技术状况
	public String saveZljszk(){
		HttpSession session = ServletActionContext.getRequest().getSession();
		String zlId = (String)session.getAttribute("zlid");
		zljszkModel.setZlid(zlId);
		this.getZljszkService().saveZljszk(zljszkModel);
		return this.SUCCESS;
	}
	//更新专利技术状况
	public String updateZljszk(){
		HttpSession session = ServletActionContext.getRequest().getSession();
		String zlId = (String)session.getAttribute("zlid2");
		zljszkModel.setZlid(zlId);
		this.getZljszkService().saveZljszk(zljszkModel);
		return this.SUCCESS;
	}
	//查找专利技术状况
	public String findZljszk(){
		HttpSession session = ServletActionContext.getRequest().getSession();
		String zlId = (String)session.getAttribute("zlid");
		this.setZljszkModel(this.getZljszkService().findZljszkByZlId(zlId));
		return this.SUCCESS;
	}
//	查找专利技术状况用于打印
	public String findZljszkToPrint(){
	
		this.setZljszkModel(this.getZljszkService().findZljszkByZlId(zlid));
		return this.SUCCESS;
	}
	//查找专利技术状况
	public String findUpdateZljszk(){
		HttpSession session = ServletActionContext.getRequest().getSession();
		String zlId = (String)session.getAttribute("zlid2");
		this.setZljszkModel(this.getZljszkService().findZljszkByZlId(zlId));
		return this.SUCCESS;
	}
	//-------------接口
	public ZljszkModel getZljszkModel() {
		return zljszkModel;
	}
	public void setZljszkModel(ZljszkModel zljszkModel) {
		this.zljszkModel = zljszkModel;
	}
	public IZljszkService getZljszkService() {
		return zljszkService;
	}
	public void setZljszkService(IZljszkService zljszkService) {
		this.zljszkService = zljszkService;
	}
	
}
